import VueRouter from 'vue-router'

//导入对应的路由组件
import HomeContainer from '../component/table/homeContainer.vue'
import MemberContainer from '../component/table/memberContainer.vue'
import ShopcarContainer from '../component/table/shopcarContainer.vue'
import SearchContainer from '../component/table/searchContainer.vue'
import NewsList from '../component/news/newList.vue'
import newInfo from '../component/news/newInfo.vue'
import photosList from '../component/photos/PhotosList.vue'
import goodsList from '../component/goods/goodsList.vue'
import goodsinfo from '../component/goods/goodsinfo.vue'

//创建路由对象
var router = new VueRouter({
    routes: [ //配置路由规则
        { path: '/', redirect: '/home'}, //设置初始路径
        { path: '/home', component: HomeContainer},
        { path: '/member', component: MemberContainer},
        { path: '/shopcar', component: ShopcarContainer},
        { path: '/search', component: SearchContainer},
        { path: '/home/newList', component: NewsList},
        { path: '/home/newinfo/:id', component: newInfo},
        { path: '/home/photosList', component: photosList},
        { path: '/home/goodsList', component: goodsList},
		{ path: '/home/goodsinfo/:id', component: goodsinfo},
		// { path: './home/goodsinfo', component: goodsinfo, name: 'goodsinfo'}
        //传参时用冒号绑定传值
    ],
    linkActiveClass: 'mui-active'//重新定义路由高亮的类名router-link-active
})
//把路由对象暴露出去
export default router